/**
 * @copyright   2010-2017, The Titon Project
 * @license     http://opensource.org/licenses/BSD-3-Clause
 * @link        http://titon.io
 */

@include export("input") {
    $titon-input-class: generate-class-name($titon-input);
    $titon-input-class-static: generate-class-name($titon-input, "static");
    $titon-input-class-choice: generate-class-name($titon-input, "choice");

    #{$titon-input-class},
    #{$titon-input-class-static},
    #{$titon-input-class-choice} {
        @extend %placeholder-inline-block;
        border: 0;
        line-height: normal;
        @include size-medium;
    }

    #{$titon-input-class-static},
    #{$titon-input-class-choice} {
        padding-#{bidi-alignment()}: 0 !important;
        padding-#{bidi-opposite-alignment()}: 0 !important;
    }

    #{$titon-input-class-choice} {
        input[type="checkbox"],
        input[type="radio"] {
            padding: 0;
            margin: 0;
            margin-#{bidi-opposite-alignment()}: .5rem;
        }
    }

    select#{$titon-input-class} {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;

        &[multiple] {
            max-height: 45rem;
        }

        &::-ms-expand {
            display: none;
        }
    }

    textarea#{$titon-input-class} {
        line-height: 1.35;
        min-height: 10rem;
    }

    //-------------------- Sizes --------------------//

    @include generate-size-small($titon-input-class) { @include size-small; }
    @include generate-size-small($titon-input-class-static) { @include size-small; }
    @include generate-size-small($titon-input-class-choice) { @include size-small; }

    @include generate-size-large($titon-input-class) { @include size-large; }
    @include generate-size-large($titon-input-class-static) { @include size-large; }
    @include generate-size-large($titon-input-class-choice) { @include size-large; }
}
